﻿<%@ Page Title="Listado de Facturas" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="listadoFacturas.aspx.cs" Inherits="Restaurante.listadoFacturas" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
         <p id="titulo"> Listado de Facturas </p>
    </h2>

    <div class="contTabla">
        <asp:GridView ID="gvFacturas" runat="server" 
            CellPadding="4" ForeColor="#333333" GridLines="None" 
            AutoGenerateColumns="False" DataKeyNames="Nro_Factura" 
            DataSourceID="ListaFActuras">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Nro_Factura" HeaderText="Nro_Factura" 
                    InsertVisible="False" ReadOnly="True" SortExpression="Nro_Factura" />
                <asp:BoundField DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" />
                <asp:BoundField DataField="Monto" HeaderText="Monto" SortExpression="Monto" />
                <asp:BoundField DataField="cajero" HeaderText="cajero" 
                    SortExpression="cajero" ReadOnly="True" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:SqlDataSource ID="ListaFActuras" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BarCafe %>" 
            ProviderName="<%$ ConnectionStrings:BarCafe.ProviderName %>" 
            SelectCommand="
SELECT f.Nro_Factura, 
	    f.Fecha,
	   f.Monto,
	   (select u.Nombre 
		from Usuario u 
		where u.Id_Usuario = f.Id_Usuario
		)cajero		
   FROM Factura f
		
"></asp:SqlDataSource>
    </div>
    <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
        onclick="btnCancelar_Click"/>
        
    
</asp:Content>
